import { api } from './request'

const requestApi = {
  erpLogin: '/user/erpLogin',
  queryFirstPower: '/user/queryFirstPower',
  queryMenuByPid: '/user/queryMenuByPid',
  userLogout: '/common/userLogout',
  queryDeptDown: '/common/queryDeptDown', // 查询所属部门下拉框
  queryAllSellerDown: '/common/queryAllSellerDown', // 查询所有销售（不区分水运陆运）

  // 费用类型
  queryCustFeeTypePageList: '/customer/queryCustFeeTypePageList',
  addCustFeeType: '/customer/addCustFeeType',
  editCustFeeType: '/customer/editCustFeeType',
  getCustFeeTypeById: '/customer/getCustFeeTypeById',
  queryDataDictionaryList: '/basicData/queryDataDictionaryList',
  addDataDictionary: '/basicData/addDataDictionary',

  // 结算类型
  queryCustomerPageList: '/customer/queryCustomerPageList', // 非结算对象
  querySettlementUnitList: '/customer/querySettlementUnitList', // 结算对象专用
  addCustomer: '/customer/addCustomer',
  editCustomer: '/customer/editCustomer',
  getCustomerById: '/customer/getCustomerById',
  getCustInfoByNameLike: '/customer/getCustInfoByNameLike',

  queryCustNameList: '/common/queryCustNameList', // 结算对象名称查询
  queryTruckNumberAndDriverDown: '/truck/queryTruckNumberAndDriverDown',
  // 查询中国省市区地名表
  queryBaseAreaList: '/common/queryBaseAreaList',

  queryTruckNumberDown: '/truck/queryTruckNumberDown', // 查询自营车牌号下拉框
  queryTruckOilCardDown: '/common/queryTruckOilCardDown', // 加油卡
  queryDriverDown: '/common/queryDriverDown', // 查询司机下拉框

  queryHolderNameList: `/common/queryHolderNameList`, // 持箱人名称查询
  queryContainerTypeList: `/common/queryContainerTypeList`, // 箱型查询
  queryPortNameList: `/common/queryPortNameList`, // 港口名称查询
  getLatestRate: `/common/getLatestRate`, // 获取最新的汇率
  queryFeeTypeList: `/common/queryFeeTypeList`, // 费用类型查询
  queryShipNameList: `/common/queryShipNameList`, // 船舶名称查询

  querySellerDown: '/common/querySellerDown', // 查询销售下拉框
  queryVoyageNumberList: '/common/queryVoyageNumberList', // 船舶航次查询

  updatePassword: '/user/updatePassword', // ERP修改密码
  sendSmsCode: '/common/sendSmsCode', // 发送短信验证码
  retrievePassword: '/common/retrievePassword', // 找回修改密码

  queryCustomerByNameLike: '/customer/queryCustomerByNameLike', // 查询客户是否存在

  getExistCustomerByName: '/customer/getExistCustomerByName',

  queryCustDown: '/common/queryCustDown', // 查询销售管理客户下拉框
  queryButtonByPid: '/user/queryButtonByPid', // 根据二级菜单id查按钮
  updateSelfHeadPortrait: '/user/updateSelfHeadPortrait'
}
export default requestApi

export const erpLogin = (data) => api(requestApi.erpLogin, data)
export const queryFirstPower = () => api(requestApi.queryFirstPower, {})
export const queryMenuByPid = (data) => api(requestApi.queryMenuByPid, data)
export const userLogout = (data) => api(requestApi.userLogout, data)
export const queryDeptDown = (data) => api(requestApi.queryDeptDown, data)

export const querySellerDown = (data) => api(requestApi.querySellerDown, data)
export const queryVoyageNumberList = (data) => api(requestApi.queryVoyageNumberList, data)

export const queryCustFeeTypePageList = (data) => api(requestApi.queryCustFeeTypePageList, data)
export const addCustFeeType = (data) => api(requestApi.addCustFeeType, data)
export const editCustFeeType = (data) => api(requestApi.editCustFeeType, data)
export const getCustFeeTypeById = (data) => api(requestApi.getCustFeeTypeById, data)
export const queryDataDictionaryList = (data) => api(requestApi.queryDataDictionaryList, data) // 查询数据字典列表
export const addDataDictionary = (data) => api(requestApi.addDataDictionary, data)

export const queryCustomerPageList = (data) => api(requestApi.queryCustomerPageList, data)
export const querySettlementUnitList = (data) => api(requestApi.querySettlementUnitList, data)
export const addCustomer = (data) => api(requestApi.addCustomer, data)
export const editCustomer = (data) => api(requestApi.editCustomer, data)
export const getCustomerById = (data) => api(requestApi.getCustomerById, data)
export const getCustInfoByNameLike = (data) => api(requestApi.getCustInfoByNameLike, data)

export const queryCustNameList = (data) => api(requestApi.queryCustNameList, data)
export const queryTruckNumberAndDriverDown = (data) => api(requestApi.queryTruckNumberAndDriverDown, data)
export const queryBaseAreaList = (data) => api(requestApi.queryBaseAreaList, data)

export const queryTruckNumberDown = (data) => api(requestApi.queryTruckNumberDown, data)
export const queryTruckOilCardDown = (data) => api(requestApi.queryTruckOilCardDown, data)

export const queryDriverDown = (data) => api(requestApi.queryDriverDown, data)

export const queryHolderNameList = (data) => api(requestApi.queryHolderNameList, data)
export const queryContainerTypeList = (data) => api(requestApi.queryContainerTypeList, data)
export const queryPortNameList = (data) => api(requestApi.queryPortNameList, data)
export const getLatestRate = (data) => api(requestApi.getLatestRate, data)
export const queryFeeTypeList = (data) => api(requestApi.queryFeeTypeList, data)
export const queryShipNameList = (data) => api(requestApi.queryShipNameList, data)

export const updatePassword = (data) => api(requestApi.updatePassword, data)
export const sendSmsCode = (data) => api(requestApi.sendSmsCode, data)
export const retrievePassword = (data) => api(requestApi.retrievePassword, data)

export const queryCustomerByNameLike = (data) => api(requestApi.queryCustomerByNameLike, data)

export const getExistCustomerByName = (data) => api(requestApi.getExistCustomerByName, data)

export const queryCustDown = (data) => api(requestApi.queryCustDown, data)

// 按钮权限接口
export const queryButtonByPid = (data) => api(requestApi.queryButtonByPid, data)
export const updateSelfHeadPortrait = (data) => api(requestApi.updateSelfHeadPortrait, data)

export const queryAllSellerDown = (data) => api(requestApi.queryAllSellerDown, data)
